import request from '@/utils/request'

// todo 获取车辆分页数据
export function getCarListApi(params) {
  return request({
    url: '/manager/truck/page',
    method: 'get',
    params
  })
}

// todo 新增车辆
export function addCarApi(data) {
  return request({
    url: '/manager/truck',
    method: 'post',
    data
  })
}

// todo 获取已经启用的车辆
export function getEnableCarListApi() {
  return request({
    url: '/manager/workingTrucks',
    method: 'get'
  })
}

// todo 获取已经停用的车辆
export function getDisableCarListApi() {
  return request({
    url: '/manager/unWorkingTrucks',
    method: 'get'
  })
}

// todo 启用车辆
export function enableCarApi(id) {
  return request({
    url: `/manager/enable/${id}`,
    method: 'put',
    id
  })
}

// todo 停用车辆
export function disableCarApi(id) {
  return request({
    url: `/manager/disable/${id}`,
    method: 'put',
    id
  })
}
